﻿
@{
    ViewBag.Title = "上传招标结果";
}

<link href="~/Resource/css/ProjectManagement.css" rel="stylesheet" />

<style>
    .hideTr{
        display:none;
    }
</style>

<div class="contentData">
    <form class="form-horizontal" id="mainForm">
        <div class="module-div">
            <h4>项目基本信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">项目名称：</td>
                        <td class="td-div" colspan="3">
                            <div></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">承办部门：</td>
                        <td class="td-div">
                            <div></div>
                        </td>
                        <td class="table_title">联系人：</td>
                        <td class="td-div">
                            <div></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">联系电话：</td>
                        <td class="td-div">
                            <div></div>
                        </td>
                        <td class="table_title">批复文件或者纪要：</td>
                        <td class="td-div">
                            <div></div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>招标信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">
                            <span>招标方式：</span>
                        </td>
                        <td class="td-div">
                            <select class="form-control" id="select" name="">
                                <option value="1">公开招标</option>
                                <option value="2">邀请招标</option>
                                <option value="3" selected>竞争性谈判</option>
                            </select>
                        </td>
                        <td class="table_title">
                            <span>资金预算及依据：</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">
                                <input type="text" name="Address" class="form-control input_unit" placeholder="" value="" readonly/>万元
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td class="table_title">
                            <span>项目概述：</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">
                                <textarea class="form-control" style="resize:none;" placeholder="请输入项目概述" readonly></textarea>
                            </div>
                        </td>
                    </tr>


                    <tr class="hideTr">
                        <td class="table_title">
                            <span>邀请谈判理由：</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">
                                <input type="text" name="Address" class="form-control" placeholder="" value="" readonly />
                            </div>
                        </td>
                    </tr>


                    <tr class="hideTr">
                        <td class="table_title">
                            <span>拟邀请潜在谈判人：</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">
                                <input type="text" name="Address" class="form-control" placeholder="" value="" readonly />
                            </div>
                        </td>
                    </tr>

                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>中标候选人前三名</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <th class="table_title" style="width: 219px;">编号</th>
                        <th class="td-div">公司名称</th>
                        <th class="table_title">价标</th>
                        <th class="td-div">备注</th>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>
                            <div class="form-group">
                                <input type="text" name="" class="form-control" placeholder="" value="" />
                            </div>
                        </td>
                        <td>
                            <div class="form-group">
                                <input type="text" name="" class="form-control" placeholder="" value="" />
                            </div>
                        </td>
                        <td>
                            <div class="form-group">
                                <input type="text" name="" class="form-control" placeholder="" value="" />
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>拟推荐单位</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">拟推荐单位：</td>
                        <td class="td-div" colspan="3">
                            <div>
                                <input class="form-control" type="text" id="ProjectId" name="ProjectId" placeholder="请输入拟推荐单位" value="" />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">推荐理由：</td>
                        <td class="td-div" colspan="3">
                            <div>
                                <textarea class="form-control" style="resize:none;" placeholder="请输入推荐理由" ></textarea>
                            </div>
                        </td>                        
                    </tr>                    
                </tbody>
            </table>
        </div>

        <div class="layui-form-item  btn-save" style="margin-top:60px;text-align:center;">
            <input type="button" lay-submit lay-filter="sub" value="暂&nbsp;&nbsp;&nbsp;存" class="layui-btn layui-btn-big save" data-state="" />
            <input type="button" lay-submit lay-filter="sub" value="提&nbsp;&nbsp;&nbsp;交" class="layui-btn layui-btn-big save" data-state="" />
            <input type="button" id="Cancel" value="取&nbsp;&nbsp;&nbsp;消" class="layui-btn layui-btn-big " />
            <input type="hidden" name="State" id="State" />
        </div>
    </form>
</div>

<script>
    $("#Cancel").on("click", function () {
        window.location.href = "/ProjectManagement/TenderResult";
    });


    $(document).ready(function () {
        var selVal = $("#select").children('option:selected').val();
        IsSelVal(selVal);
        $("#select").change(function () {
            selVal = $(this).children('option:selected').val();
            IsSelVal(selVal);
        });
        function IsSelVal(selVal) {
            if (selVal == 1 || selVal == 2) {
                $(".hideTr").hide();
            }
            if (selVal == 3) {
                $(".hideTr").show();
            }
        }
    });



    layui.use(['layer', 'form', 'element', 'laypage'], function () {
        var layer = layui.layer, form = layui.form, element = layui.element, $ = layui.jquery, laypage = layui.laypage;

        //数据提交
        $(".save").click(function () {


            layer.msg("操作成功", { time: 1000, icon: 1 }, function () {
                window.location.href = "/ProjectManagement/TenderResult";
            });


            //var fileDataArray = [];
            //$(".fileShow-append tr:not(.headtr)").each(function (index, item) {
            //    fileDataArray.push({
            //        Name: $(item).find("#updata").data("name"),
            //        GuidId: $(item).find("#updata").data("id"),
            //        Size: $(item).find("#updata").data("size"),
            //        Group: $(item).find("#updata").data("group"),
            //        FilePath: $(item).find("#updata").data("url"),
            //        TypeNo: $(item).find("#updata").data("typeno"),
            //        TypeName: $(item).find("#updata").data("typename"),
            //        Sort: index + 1
            //    })
            //});
            //var fileDataJson = JSON.stringify(fileDataArray);
            //$("#fileDataJsonFile").val(fileDataJson);
            ////对表单进行验证
            //var bv = $('#mainForm').data('bootstrapValidator');
            //bv.validate();

            //$("#State").val($(this).data("state"))//提交或保存的状态值
            //var search = $("form").serialize();
            //if (bv.isValid()) {
            //    $.post("Add", search, function (data) {
            //        if (data.Flag) {
            //            layer.msg("操作成功", { time: 1000, icon: 1 }, function () {
            //                window.location.href = "/TzResearch/Index";
            //            });
            //        } else {
            //            layer.alert(data.Message, { icon: 2 });
            //        }
            //    });
            //}
        });

    });
</script>